
#include <boost/test/unit_test.hpp>


#define _DEBUGING
#include "../Handle.h"




class FixtureHandle
{
public:


    FixtureHandle()
    {

    }

};


BOOST_FIXTURE_TEST_CASE( TestHandle_1, FixtureHandle )
{
    Handle<int,16> handle1;
    Handle<int,16> handle2;

    BOOST_CHECK(handle1.isNull());
    BOOST_CHECK(handle2.isNull());

    handle1.init(1);
    handle2.init(2);

    BOOST_CHECK(handle1.getHandle()!=handle2.getHandle());

    BOOST_CHECK(handle1.getIndex()==1);
    BOOST_CHECK(handle2.getIndex()==2);

    BOOST_CHECK(handle1.getMagic()!=handle2.getMagic());

    BOOST_CHECK(!handle1.isNull());
    BOOST_CHECK(!handle2.isNull());

    BOOST_CHECK(handle1!=handle2);

    handle2=handle1;

    BOOST_CHECK(handle1==handle2);


    Handle<int,16> handle3;
    handle3.init(0);
    BOOST_CHECK(!handle3.isNull());


}
